<template>
  <div id="app">
    <meta name="referrer" content="never">
    <div class="bodyMainView">
      <keep-alive>
        <router-view />
      </keep-alive>
    </div>
  </div>
</template>

<script>
export default {
  name: 'App',
  computed: {},
  beforeCreate() {
    this.$store.state.renovateFlag = true
  },
  mounted() {
    if (window.performance.navigation.type == 1) {
      // 这个状态是为了刷新之后不不执行钩子函数，为了减少服务器请求次数，减少服务器压力
      this.$store.state.renovateFlag = false
    } else {
      // 暂不进行任何操作
    }
  },
  methods: {
    isBlank(objce) {
      if (objce === null || objce === '' || isFlag(objce, 'undefined') || isFlag(objce, 'null') || isFlag(JSON.stringify(objce), '{}') || isFlag(JSON.stringify(objce), '[]')) {
        return true
      } else {
        return false
      }
    },
    isFlag(object, value) {
      if (object == value || JSON.stringify(object) == value || encodeURIComponent(object) == encodeURIComponent(value)) {
        return true
      } else {
        return false
      }
    }
  }
}
</script>

<style>
  .bodyMainView {
    position: absolute;
    width: 100%;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    box-sizing: border-box;
    background-color: #f5f5f5;
  }
</style>
